@extends('layouts.user_home')
@section('content')
<link href="/home/css/infstyle.css" rel="stylesheet" type="text/css">

		<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<!--标题 -->
					<div class="user-safety">
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">账户安全</strong> / <small>Set&nbsp;up&nbsp;Safety</small></div>
						</div>
						<hr/>

						<!--头像 -->
						<div class="user-infoPic" >

							<div class="filePic"style="margin-top:0px;">
								<img class="am-circle am-img-thumbnail" src="{{$userinfo->image}}" alt="" style="height:128px;"/>
							</div>

							<p class="am-form-help">头像</p>

							<div class="info-m">
								<div><b>用户名：<i>{{$user->name}}</i></b></div>
								<div class="u-level">
									<span class="rank r2">
							             <s class="vip1"></s><a class="classes" href="#">铜牌会员</a>
						            </span>
								</div>
								<div class="u-safety">
									<a href="safety.html">
									 账户安全
									<span class="u-profile"><i class="bc_ee0000" style="width: 60px;" width="0">60分</i></span>
									</a>
								</div>
							</div>
						</div>
						<br><br>
						<div class="check">
							<ul>
								<li>
									<i class="i-safety-iphone"></i>
									<div class="m-left">
										<div class="fore1">手机验证</div>
										<div class="fore2"><small>您验证的手机：186XXXXXXXX 若已丢失或停用，请立即更换</small></div>
									</div>
									<div class="fore3">
										<a href="bindphone.html">
											<div class="am-btn am-btn-secondary">换绑</div>
										</a>
									</div>
								</li>
								<br><br><br>
								<li>
									<i class="i-safety-mail"></i>
									<div class="m-left">
										<div class="fore1">邮箱验证</div>
										<!-- <div class="fore2"><small>您验证的邮箱：5831XXX@qq.com 可用于快速找回登录密码</small></div> -->
										
									</div>

									<div class="fore3">

										
											<div class="am-btn am-btn-secondary" id="bondmail">绑定邮箱</div>
										
									</div>
								</li>

								<li>
									<div style="margin-left:200px;">
										请输入绑定邮箱:<input type="email" id="email"><br><br>
										<input type="text" id="code" placeholder="请输入验证码">
										<div class="am-btn am-btn-secondary" id="getCode">点击获取验证码</div>
									</div>
								</li>
							</ul>
						</div>

					</div>
				</div>
				<!--底部-->
			<script src="/home/js/jquery-1.8.2.min.js" type="text/javascript"></script>
			<script>
				$(function(){
					$('#getCode').click(function(){
						var mail = $('#email').val();
						// console.log(mail);
						$.ajax({
		                    type: 'GET',
		                    url: '/mail',
		                    data:{mail:mail},
		                    dataType: 'text',
		                    async:true,
		                    success: function(data){
		                        
		                    },
		                    error:function(data) {
		                        console.log(data.msg);
		                    },
		                });
					});


					$('#bondmail').click(function(){
						var code = $('#code').val();
						// console.log(code);
						$.ajax({
		                    type: 'GET',
		                    url: '/checkmail',
		                    data:{code:code},
		                    dataType: 'text',
		                    async:true,
		                    success: function(data){
		                        if(data){
		                        	alert('绑定成功');
		                        }
		                    },
		                    error:function(data) {
		                        console.log(data.msg);
		                    },
		                });
					
					});
				});
				

			</script>
@endsection